<?php defined('IN_ADMIN') or exit('No permission resources.');?>
<?php include $this->admin_tpl('header', 'admin');?>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>content_addtop_new.js"></script>
<?php $column_name = $column_name?"《".$column_name."》":"";?>
<div class="subnav">
	<div class="content-menu ib-a blue line-x">
		
	</div>
</div>
<div class="pad-lr-10">

	<div id="searchid" style="">
		<form name="searchform" action="" method="get" >
			<input type="hidden" value="<?php echo ROUTE_M;?>" name="m">
			<input type="hidden" value="<?php echo ROUTE_C;?>" name="c">
			<input type="hidden" value="<?php echo ROUTE_A;?>" name="a">
			<input type="hidden" value="<?php echo $source_type;?>" name="source_type">
			<input type="hidden" value="1" name="search">
			<input type="hidden" value="<?=$pass_id?>" name="pass_id">
			<input type="hidden" value="<?=$column_name?>" name=name>
			<input type="hidden" value="<?php echo $pc_hash;?>" name="pc_hash">
			<table width="100%" cellspacing="0" class="search-form">
				<tbody>
				<tr>
					<td>
						<button type="button" style="float:right;margin-right:30px;margin-top:10px;border-radius:5px;background:white;" onclick="showSelect()" ><span style="color:red;font-size:15px;">选择选手</span></button>
						<span style="clear: both"></span>
						<script>
							function  showSelect(){
								window.top.art.dialog({
										id: 'select',
										iframe: '?m=pass_game&c=talent&a=bindTalent&pass_id=<?=$pass_id?>',
										title: '选择选手',
										width: '900',
										height: '500',
										lock: true
									},
									function() {
										var d = window.top.art.dialog({
											id: 'select'
										}).data.iframe;
										var relation = d.document.getElementById('relation');


										if(relation.value!=""){
											$.ajax({
												type:"get",
												url:"?m=pass_game&c=talent&a=bindContestAjax&pass_id=<?=$pass_id?>&relation="+relation.value+"&pc_hash=<?php echo $_SESSION['pc_hash'];?>&pass_name=<?php echo $column_name?>",
												dataType: "json",
												success:function(data){
													if(data['status']){
														window.top.art.dialog({
															id: 'select'
														}).close()
														window.location.reload();
													}else{
														alert(data['msg']);
														return false;
													}
												}
											})
										}else{
											return true;
										}

									},
									function() {
										window.top.art.dialog({
											id: 'select'
										}).close()
									});
							}
						</script>


						<div class="explain-col">
							人才类型：
							<?php echo form::select($types, $_GET['talent_type'], 'name="talent_type"', '请选择')?>
							真实姓名：<input name="user_name" type="text" value="<?php echo $_GET['user_name']?>" class="input-text" />
							<input type="submit" name="search" class="button" value="<?php echo L('search');?>" />
						</div>
					</td>
				</tr>
				</tbody>
			</table>
		</form>
	</div>

	<form name="myform" id="myform" action="" method="post" >
		<div class="table-list">
			<table width="100%">
				<thead>
				<tr>
					<th width="16"><input type="checkbox" value="" id="check_box" onclick="selectall('id[]');"></th>
					<!-- <th width="57"><?php //echo L('listorder');?></th> -->
					<th width="40">ID</th>
					<th>姓名</th>
					<th>身高(单位:cm)</th>
					<th>体重(单位:kg)</th>
					<th>性别</th>
					<th>人才纵图</th>
					<th width="200"><?php echo L('operations_manage');?></th>
				</tr>
				</thead>
				<tbody>
				<?php
				if(!empty($talentinfo)) {

				    $talent_id = array();#收集人才id
					foreach ($talentinfo as $k=> $r) {
					    $talent_id[] = $r['tid'];
						?>
						<tr>
							<td align="center"><input class="inputcheckbox " name="id[]" value="<?php echo $r['cid'];?>" type="checkbox"></td>
							<!-- <td align='center'><input name='listorders[<?php echo $r['cid'];?>]' type='text' size='3' value='<?php //echo $r['list_order'];?>'  class='input-text-c list_orders'></td> -->
							<td align='center' ><?php echo $r['cid'];?></td>
							<td align='center' ><?php echo $r['real_name'];?></td>
							<td align='center' ><?php if(!empty($r['height'])){echo $r['height'];}else{echo '<font color="red">（未设置）</font>';}?></td>
							<td align='center' ><?php if(!empty($r['weight'])){echo $r['weight'];}else{echo '<font color="red">（未设置）</font>';}?></td>
							<td align='center'><?php if($r['gender'] == '1'){echo '男';}elseif($r['gender'] == '2'){echo '女';}elseif($r['gender'] == '3'){echo '保密';}?></td>
							<td align='center'><?php if(!empty($r['image_shuxing'])){?><a href="javascript:image_priview('<?=$r['image_shuxing']?>');"><?php echo '<img src="'.$r['image_shuxing'].'" height="60px" title="点击可预览：'.$r['real_name'].'的照片！">';?></a><?php }else{echo '<font color="red">（未设置）</font>';}?></td>
							<td align='center'><a href="?m=pass_game&c=talent&a=pic_manage_edit&talent_id=<?php echo $r['tid']?>&pass_id=<?php echo $pass_id;?>&real_name=<?php echo $r['real_name'];?>"><?php echo L('pic_manage_edit')?></a>&nbsp;|&nbsp;<a href="?m=pass_game&c=talent&a=delete&talent=1&id=<?php echo $r['cid']?>&talent_id=<?php echo $r['tid'];?>&real_name=<?php echo $r['real_name'];?>&name=<?php echo $column_name;?>" onClick="return confirm('<?php echo L('confirm', array('message' => new_addslashes($r['real_name'])))?>')"><?php echo L('del')?></a>&nbsp;|&nbsp;<a href="?m=pass_game&c=talent&a=pic_manage&talent_id=<?php echo $r['tid']?>&pass_id=<?php echo $pass_id;?>&name=<?php echo $column_name;?>&real_name=<?php echo $r['real_name'];?>"><?php echo L('pic_manage')?></a></td>

						</tr>
					<?php }
					$talent_id_str = implode(',', $talent_id);
				} else {
					echo "<tr><td colspan='8' style='color:red;font-size:18px;text-align:center;'><span>暂无".$column_name."选手相关数据，请点击右上角[选择选手]！</span></td></tr>";
				}
				?>
				</tbody>
			</table>
			<div class="btn"><label for="check_box"><?php echo L('selected_all');?>/<?php echo L('cancel');?></label>
				<input type="hidden" value="<?php echo $pc_hash;?>" name="pc_hash">
				<!-- <input type="button" class="button" value="<?php //echo L('listorder');?>" onclick="myform.action='?m=pass_game&c=talent&a=listorder&dosubmit=1&talent=1&steps=<?php //echo $steps;?>';myform.submit();"/> -->
				<input type="button" class="button" value="<?php echo L('del');?>" onclick="myform.action='?m=pass_game&c=talent&a=delete&dosubmit=1&talent=1&steps=<?php echo $steps;?>&pass_id=<?php echo $pass_id;?>&name=<?php echo $column_name;?>';return confirm_delete()"/>
			</div>
			<div id="pages"><?php echo $pages;?></div>
		</div>
	</form>
</div>
<script language="javascript" type="text/javascript" src="<?php echo JS_PATH?>cookie.js"></script>
<script type="text/javascript">

	function confirm_delete(){
		if(confirm('<?php echo L('confirm');?>')) $('#myform').submit();
	}
</script>
</body>
</html>